feat(runtime): start interactive sessions fresh instead of continuing - #56
Merged
Conversation
A bare `woopcode` continued the newest session in the project, and the home screen renders only on an empty timeline. So from the second launch onwards the home screen silently stopped appearing — the restored transcript took its place, with nothing on screen saying a conversation had been restored or which one. Resuming is now something you ask for: `-c`/`--continue` for the newest, `--resume` for a particular one or a picker. `-p` already worked this way, so the two entry points no longer disagree about a default. The alternative was to keep continuing but render the home screen over it. That is worse: it puts the wordmark and the prompt examples of a fresh start in front of a session the model can already see. `--new` is kept rather than removed. It is now the default interactively, but it still does real work beside `-p --continue`, and dropping a shipped flag breaks callers. Nothing is lost either way — the session file is still written after every turn, and a launch that takes no turn writes nothing at all.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A bare
woopcodecontinued the newest session in the project, andApprenders the home screen only when the timeline is empty (tui/src/app.tsx:42). Those two facts compose into a bug nobody wrote: from the second launch onwards the home screen silently stopped appearing, because the resumed conversation was hydrated into the timeline before the first frame. Nothing on screen said a conversation had been restored, or which one — the wordmark, the prompt examples and the capability row just stopped showing up, and the only way to get them back was a flag you had no reason to know about.Resuming is now something you ask for.
sessionOptionsFromdrops|| mode === "interactive"fromcontinueLatest, so a bare launch starts fresh in both modes and-c/--continue,--resume <ref>and a bare--resumepicker are the ways back.-palready behaved this way, so the two entry points no longer disagree about a default — which is what made the old code need a paragraph of comment to explain itself.The alternative was to keep continuing and render the home screen over the restored session. That is worse: it puts the wordmark and the prompt examples of a fresh start in front of a conversation the model can already see, which is the same invisible state with a friendlier face on it.
--newis kept rather than removed — it is the interactive default now, but it still does real work beside-p --continue, and dropping a shipped flag breaks callers.Nothing is lost by this. The session file is still written after every turn, and a launch that takes no turn writes nothing at all, so fresh-by-default leaves no empty sessions behind.
One consequence worth flagging for review: a bare
--resumeused to open its picker over the newest session, so Esc fell back into it. Nothing is loaded behind the picker now, so Esc leaves you in the fresh session instead.SessionPickeralready optional-chainscontroller.currentSession?.()?.id, so it handles having no active session, and the stale comment at the call site is corrected in this commit.Five doc files carried the old promise:
docs/guides/sessions-and-history.md(intro, the resuming table, and the "Two windows on one conversation" section, whose premise was that both windows auto-continue),docs/reference/cli.md,docs/getting-started/first-session.md,docs/introduction/how-a-turn-works.mdandREADME.md. The last two were already wrong before this change — both still claimed history was one global file rather than per-project, which sessions replaced in #52 — so they are corrected here too rather than left half-true.Verified with
bun run verify --all, which printed4 gate(s) passed(docs lint, docs surface, type check, tests); the pre-commit hook ran it again over the staged tree and printed3 gate(s) passed, the docs surface being unaffected. The two rewritten tests inpackages/tests/config/sessionFlags.test.tswere proven rather than trusted: restoring|| mode === "interactive"madea bare interactive launch starts a fresh sessionfail withExpected: false / Received: true, and removing it again went green. The other nine tests in that file are untouched and still pass. Agrepsweep for the old promise acrossdocs/andREADME.mdreturns only an unrelated hit about Anthropic thinking blocks.Not verified: the actual TTY behaviour.
bun testdoes not drive a real terminal, so the sequence that matters end to end — launch, send a message, quit, relaunch and see the home screen, then-cto get the conversation back, then--resumefor the picker — has not been run and is worth doing by hand before this leaves draft.